<?php
/**
 * A special user class for non-authed users which always belong
 * to guests group and have no id in the db etc.
 */
class Model_GuestUser extends Model_User {
	
   
   public function __construct() {      
      
      $userModel = new Model_User();
      $user = $userModel->findOneBy('username', 'guest');
//      $user = Model_User::findByName('guest');
      
      $this->setId($user->getId());
      $this->setUserName($user->getUserName());
      $this->setPassword($user->getPassword());
   }
   
   public function getGroups() {
      $groupModel =  new Model_Group();
      $groups = $groupModel->findBy('name', 'guests');
		return $groups;
		
	}
   
	public function getRoleId() {		
	   return 'user-'.$this->getId();
	}
}